<?php	
//cette page code le corps de l'acceuil du site internet
include("verification.php");
if(isset($_GET['id']))
	$_GET['id'] = intval ($_GET['id']);
$Equipe = mysql_query('SELECT * FROM equipe WHERE idEquipe != 0');
$Rubrique = (mysql_fetch_array(mysql_query('SELECT titre,title FROM rubrique WHERE id = 9')));
$RubriqueName = $Rubrique['titre'];
if (preg_match("#MSIE#", $_SERVER["HTTP_USER_AGENT"]))
	$IE = 1;
else
	$IE = 0;
?>	
	
<br/>


<table style="border-collapse:collapse;margin:0px; padding:0px;" cellspacing="0" cellpadding="0" >	
	<tr>
	<?php while ($Personne = mysql_fetch_array($Equipe)) {
	if ($Personne['Affichage'] == 'Actif'){
	?>
		<td>
			<div style="padding-top:<?php echo $Personne['Margin']?>px;padding-left:<?php echo $Personne['MarginLeft']?>px">
			<div id="personne<? echo $Personne['idEquipe']?>"style="display:block;cursor:pointer;" onClick="griser(<? echo $Personne['idEquipe']?>);">
			<img src="<?php echo $Personne['LienProfil']?>" title="<?php echo stripslashes($Personne['Nom'])?>" alt="<?php echo stripslashes($Personne['Nom'])?>"></div>
			<div id="personne_grise<? echo $Personne['idEquipe']?>" style="display:none;cursor:pointer;" onClick="griser(<? echo $Personne['idEquipe']?>);">
			<img src="commonsTemplates/imagegrise.php?Lien=<?php echo $Personne['LienProfil']?>" title="<?php echo stripslashes($Personne['Nom'])?>" alt="<?php echo stripslashes($Personne['Nom'])?>">
			</div>
			<div></div>
		</td>
	<?php } } ?>
	</tr>
</table>

<?php 
$Equipe = mysql_query('SELECT * FROM equipe WHERE idEquipe != 0');
$widthtot = 0;
while ($Personne = mysql_fetch_array($Equipe)) {
	if ($Personne['Affichage'] == 'Actif'){
	if (isset($_GET['id']) && $_GET['id'] == $Personne['idEquipe']) {
	?>
		<div style="background:url('images/equipe/triangle.jpg');height:30px ;width:59px;margin-left:<? echo $widthtot?>px;">&nbsp;
		</div>
	<?}else{
	$size = getimagesize($Personne['LienProfil']);
	$widthtot += $size[0] + $Personne['MarginLeft'];
	}?>
	<?}}
	if (!isset($_GET['id']))
		echo '<br/>';
	?>

<?php 
$Equipe = mysql_query('SELECT * FROM equipe');
while ($Personne = mysql_fetch_array($Equipe)) {
if ($Personne['Affichage'] == 'Actif'){
?>
<div id="personne_bloc<?echo $Personne['idEquipe'];?>" style="display:<?if($Personne['idEquipe'] == 0){?>block<?}else{?>none<?}?>;width:<? if($IE){?>690<?}else{?>670<?}?>px; background-color:rgb(248,248,248);border:rgb(231,231,231) 1px solid; color:rgb(100,100,100); padding:10px;font-family:Arial">

<table style="border-collapse:collapse;margin:0px; padding:0px;" cellspacing="0" cellpadding="0" >	
	<tr>
		<td valign="top"><img  src="<?php echo stripslashes($Personne['LienPhoto'])?>" title="<?php if ($Personne['idEquipe'] == 0) echo stripslashes($Personne['Nom'.$langue]); else echo stripslashes($Personne['Nom']); ?>" alt=""></td>
		<td valign="top" style="padding-left:20px;text-align : justify; ">
		<span  style="font-size:18px; color:black;text-align : justify;"><?php if ($Personne['idEquipe'] == 0) echo stripslashes($Personne['Nom'.$langue]); else echo stripslashes($Personne['Nom']); ?></span><?php if (isset($_GET['id'])){ ?><br/><?php }?>
		<span  style="font-size:14px;"><i><?php echo stripslashes($Personne['Poste'.$langue])?></i></span><br/><br/>
		<span  style="font-size:12px;text-align : justify; "><?php echo stripslashes(nl2br($Personne['Description'.$langue]))?><br/></span>
		</td>
	</tr>
</table>

</div>
<?}}?>
<br/>


<script type="text/javascript">
function griser(id)
{
	var i = 0;
	<?php
	$Equipe = mysql_query('SELECT * FROM equipe WHERE idEquipe != 0');
	while ($Personne = mysql_fetch_array($Equipe)) {
	if ($Personne['Affichage'] == 'Actif'){
	?>
	
		if ( <? echo $Personne['idEquipe']; ?> == id)
		{
			$('personne' + <? echo $Personne['idEquipe']; ?>).style.display = 'block';
			$('personne_grise' + <? echo $Personne['idEquipe']; ?>).style.display = 'none';
			$('personne_bloc' + <? echo $Personne['idEquipe']; ?>).style.display = 'block';
		}
		else
		{
			$('personne_grise' + <? echo $Personne['idEquipe']; ?>).style.display = 'block';
			$('personne' + <? echo $Personne['idEquipe']; ?>).style.display = 'none';
			$('personne_bloc' + <? echo $Personne['idEquipe']; ?>).style.display = 'none';
		}
	$('personne_bloc0').style.display = 'none';
	<?}}?>
	
}

</script>

